Learn R Programming

regtools (version 1.7.0)

Penrose Linear: Penrose-Inverse Linear Models and Polynomial Regression

Description

Provides mininum-norm solutions to linear models, identical to OLS in standard situations, but allowing exploration of overfitting in the overparameterized case. Also provides a wrapper for the polynomial case.

Usage

penroseLM(d,yName)
penrosePoly(d,yName,deg,maxInteractDeg=deg)
ridgePoly(d,yName,deg,maxInteractDeg=deg)
# S3 method for penroseLM
predict(object,...)
# S3 method for penrosePoly
predict(object,...)

Arguments

...

Arguments for the predict functions.

d

Dataframe, training set.

yName

Name of the class labels column.

deg

Polynomial degree.

maxInteractDeg

Maximum degree of interaction terms.

object

A value returned by penroseLM or penrosePoly.

Details

First, provides a convenient wrapper to the polyreg package for polynomial regression. (See qePoly here for an even higher-level wrapper.) Note that this computes true polynomials, with cross-product/interaction terms rather than just powers, and that dummy variables are handled properly (to NOT compute powers).

Second, provides a tool for exploring the "double descent" phenomenon, in which prediction error may improve upon fitting past the interpolation point.